package com.polysichong.netschool.service.admin.impl;

import java.util.List;

import com.polysichong.netschool.dao.admin.UserDao;
import com.polysichong.netschool.entity.admin.User;
import com.polysichong.netschool.service.admin.UserService;

public class UserServiceImpl implements UserService{

	private UserDao userDao;

	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public void save(User user) {
		userDao.saveUser(user);
	}

	@Override
	public List<User> findAllUsers() {
		return userDao.findAllUsers();
	}

	@Override
	public void update(User user) {
		userDao.updateUser(user);
	}

	@Override
	public void delete(Long id) {
		userDao.deleteUser(id);
	}

	@Override
	public User getUserById(Long id) {
		return userDao.findUserById(id);
	}
}
